package springboot.com.elasticsearch.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import springboot.com.elasticsearch.bean.Demo;
import springboot.com.elasticsearch.serviceImpl.DemoServiceEs;

@RestController
@RequestMapping(value = "/es")
public class DemoControllerEs {
  @Autowired
  private DemoServiceEs demoServiceEs;

  @RequestMapping("/list")
  public Iterable<Demo> list() {
	  demoServiceEs.save(new Demo("test123123123"));
    return demoServiceEs.findAll();
  }
}
